package com.huxin.soa;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.config.server.EnableConfigServer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.MutablePropertySources;
import org.springframework.core.env.PropertySource;

import java.util.Iterator;

@SpringBootApplication
@EnableConfigServer
public class MyConfigServerApplication {

	public static void main(String[] args) {
		ConfigurableApplicationContext context = SpringApplication.run(MyConfigServerApplication.class, args);

		ConfigurableEnvironment environment = context.getEnvironment();

		MutablePropertySources propertySources = environment.getPropertySources();

		Iterator<PropertySource<?>> iterator = propertySources.iterator();

		while (iterator.hasNext()) {
			PropertySource propertySource = iterator.next();
			System.out.println(" >>>>>> " + propertySource.getName());
		}

	}
}
